<!--继承基础框架-->
{% extends "../layout/base.html" %}

<!--引入左侧边，并传值-->
{% import "../layout/side.html" as side %}
{% block side %}
    {{ side.aside('home') }}
{% endblock %}

<!--引入正文部分-->
{% block content %}
<section class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1>修改资料</h1>
            </div>
        </div>
    </div><!-- /.container-fluid -->
</section>

<!-- Main content -->
<section class="content">

    <div class="card card-primary">
        <div class="card-header">
            <h3 class="card-title">修改密码/昵称</h3>
        </div>
        <!-- /.card-header -->
        <!-- form start -->
        <form role="form" id="form">
            <div class="card-body">
                <div class="form-group">
                    <label >用户昵称</label>
                    <input type="text" class="form-control" name="nickname" placeholder="用户昵称" value="{{user.username}}">
                </div>
                <div class="form-group">
                    <label>原密码</label>
                    <input type="password" class="form-control"  name="oldpass" placeholder="原密码">
                </div>
                <div class="form-group">
                    <label>新密码</label>
                    <input type="password" class="form-control" name="password" placeholder="新密码">
                </div>
                <div class="form-group">
                    <label>确认密码</label>
                    <input type="password" class="form-control"  name="repassword" placeholder="确认密码">
                </div>
            </div>
            <!-- /.card-body -->

            <div class="card-footer">
                <button type="button" id="saveBtn" class="btn btn-primary" onclick="clickSave();">保存修改</button>
            </div>
        </form>
    </div>
    <!-- /.card -->

</section>
{% endblock %}

<!--JS引入-->
{% block scripts %}

<script type="text/javascript">
    function clickSave() {
      var data = formJson("form");
      console.log(data);
      requestAjax("/admin/modifyAction",data,null,true,"saveBtn");
    }
</script>

{% endblock %}
